#! /bin/sh

# execute this script from the top-level directory
HOSTNAME=`hostname`

OPT='-O3 -mcpu=itanium -complex_limited_range'
CFLAGS=$OPT
CXXFLAGS=$OPT
FFLAGS="$OPT -WB -w90 -w95"
CPPFLAGS="-I$HOME/include -L/usr/local/intel/mkl/include"
LDFLAGS="-L$HOME/lib -L/usr/local/intel/mkl/lib/64"
MAKE=make

FLIBS="-L/usr/local/intel/compiler70/ia64/lib -lm -L/usr/lib -lintrins -lIEPCF90 -lF90 -limf -lirc -lcxa -lunwind"

CC=ecc
CXX=ecc
F77=efc
F90=efc

export CC CXX F77 F90 LDFLAGS CFLAGS FFLAGS CPPFLAGS CXXFLAGS MAKE FLIBS

OMP_NUM_THREADS=1; export OMP_NUM_THREADS

rm -rf $HOSTNAME
mkdir $HOSTNAME

( 
  cd $HOSTNAME
  ../configure --disable-single --with-f90
  make -k; make -k; make -k benchmark; make clean
  ../configure --enable-single --with-f90
  make -k; make -k; make -k benchmark; make clean
  make collect
)
